FROM python:3.13.9-slim
ENV TZ=Asia/Shanghai
RUN python -m pip install Django==5.2.8 && django-admin startproject mysite
WORKDIR /mysite
CMD ["python", "manage.py", "runserver","0.0.0.0:8000"]
# docker build -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/django:5.2.8-py3.13 .
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/django:5.2.8-py3.13
# docker run -it rgistry.cn-hangzhou.aliyuncs.com/xiaoyilin/django:5.2.8-py3.13 bash
# docker run -d -p 8000:8000 registry.cn-hangzhou.aliyuncs.com/xiaoyilin/django:5.2.8-py3.13

# python -m django --version
# 创建项目
# django-admin startproject mysite
# 开发服务器
# python manage.py runserver
# http://127.0.0.1:8000/
# 创建app
# python manage.py startapp myapp

# Windows安装
# py --version
# py -m venv project-name
# project-name\Scripts\activate.bat
# py -m pip install Django==5.2.8
# 验证
# import django
# print(django.get_version())